<template>
	<view class="app">
		<view class="header">
			<view class="header-left">共计3件商品</view>
			<view class="header-right">
				<text @click="toggleHandle">{{ isDeleted ? '删除' : '管理' }}</text>
				<image class="header-icon" src="../../static/share.png"></image>
				<image class="header-icon" src="../../static/wechat.png"></image>
			</view>
		</view>
		<view class="cart-item" v-for="index in 3">
			<view class="goods-list">
				<view class="goods-item">
					<image class="check-icon" src="../../static/checked.png"></image>
					<image class="goods-img" src="../../static/dengl.jpg"></image>
					<view class="goods-body">
						<view class="goods-body-top">
							<view class="goods-name two-line">飘柔洗发水 450ml</view>
							<view class="goods-label-box">
								<view class="goods-label">450ml</view>
							</view>
						</view>
						<view class="goods-bottom">
							<view class="goods-price">
								<text>¥</text>
								19.9
							</view>
							<view class="num-box">
								<view class="jianfa">-</view>
								<input type="number" value="1" />
								<view class="jiafa">+</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

	</view>
</template>
<script>
export default {
	data() {
		return {
			goodsNum: 1,
			buttonStyle: {
				width: '196rpx',
				height: '68rpx',
				backgroundColor: '#E23C2B',
				fontSize: '26rpx',
				fontWeight: 'bold'
			},
			isDeleted: false
		};
	},
	methods: {
		toggleHandle() {
			this.isDeleted = this.isDeleted ? false : true;
		}
	}
};
</script>

<style scoped lang="scss">
page {
	background-color: #f4f4f4;
	padding-top: 80rpx;
	padding-bottom: 120rpx;
}
.header {
	height: 80rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 31rpx;
	font-size: 26rpx;
	background-color: #f6f6f6;
	position: fixed;
	top: 44px;
	left: 0;
	width: 690rpx;
	z-index: 555;
	.header-left {
		color: #797979;
	}
	.header-right {
		width: 187rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		color: #111;
		.header-icon {
			width: 32rpx;
			height: 32rpx;
		}
	}
}
.cart-item {
	margin: 20rpx;
	border-radius: 20rpx;
	background-color: #fff;
	.cart-title {
		display: flex;
		align-items: center;
		padding: 0 10rpx;
	}
	.activity-box {
		display: flex;
		align-items: center;
		font-size: 22rpx;
		color: #000;
		font-weight: bold;
		padding:  20rpx 0 73rpx;
	}
}
.check-icon {
	width: 32rpx;
	height: 32rpx;
	margin-left: 20rpx;
	margin-right: 25rpx;
}
.goods-item {
	padding: 20rpx 0 40rpx 0;
	background-color: #fff;
	display: flex;
	align-items: center;
	border-radius: 20rpx;
	.goods-img {
		width: 180rpx;
		height: 180rpx;
	}
	.goods-body {
		width: 410rpx;
		height: 180rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		margin-left: 25rpx;
	}
	.goods-name {
		font-size: 26rpx;
		color: #333;
		line-height: 1.5;
		margin-bottom: 10rpx;
	}
	.goods-label-box {
		.goods-label {
			display: inline-block;
			width: 80rpx;
			height: 40rpx;
			line-height: 40rpx;
			border-radius: 20rpx;
			background-color: #f5f5f5;
			color: #797979;
			font-size: 20rpx;
			text-align: center;
			transform: scale(0.8);
			transform-origin: 0;
		}
	}
	.goods-bottom {
		display: flex;
		justify-content: space-between;
		.goods-price {
			font-size: 32rpx;
			color: #ff007f;
			font-weight: bold;
			text {
				font-size: 0.7em;
				margin-right: 5rpx;
			}
		}
		.num-box {
			display: flex;
			align-items: center;
			.jianfa{
				display: flex;
				justify-content: center;
				align-items: center;
				width: 60rpx;
				height: 53rpx;
				background: #e7e7e7;
				color: #303133;
				font-size: 35rpx;
				font-weight: bold;
				border-radius: 10rpx 0 0 10rpx;
			}
			input{
				width: 40rpx;
				background: #e7e7e7;
				text-align: center;
				padding: 5rpx 20rpx;
			}
			.jiafa{
				display: flex;
				justify-content: center;
				align-items: center;
				width: 60rpx;
				height: 53rpx;
				background: #e7e7e7;
				color: #303133;
				font-size: 35rpx;
				font-weight: bold;
				border-radius:0 10rpx 10rpx 0;
			}
		}
	}
}
</style>
